package com.bykj.property.sys.controller;

import com.bykj.property.controller.vo.response.RespResult;
import com.bykj.property.model.SysUser;
import com.bykj.property.sys.controller.vo.ValidateInfo;
import com.bykj.property.sys.service.ValidateService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;

/**
 * @author yiming
 * @title: ValidateController
 * @projectName property
 * @description: TODO
 * @date 2019/6/2715:13
 */
@Slf4j
@Api(tags = {"校验"})
@RestController
@RequestMapping("/admin/validate")
public class ValidateController {
    @Autowired
    private ValidateService validateService;
    @ApiOperation(value = "添加唯一校验")
    @RequestMapping(value = "/uniqueAdd", method = {RequestMethod.POST, RequestMethod.GET}, produces = "application/json;charset=UTF-8")
    public RespResult uniqueValidateAdd(ValidateInfo info) {
        return RespResult.ok(validateService.uniqueValidateAdd(info));
    }
    @ApiOperation(value = "更新唯一校验")
    @RequestMapping(value = "/uniqueUpdate", method = {RequestMethod.POST, RequestMethod.GET}, produces = "application/json;charset=UTF-8")
    public RespResult uniqueValidateUpdate(ValidateInfo info) {
        return RespResult.ok(validateService.uniqueValidateUpdate(info));
    }
}
